home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / exec / openresource.c < prev    next >
C/C++ Source or Header  |  1996-10-24  |  2KB  |  78 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: openresource.c,v 1.5 1996/10/24 15:50:53 aros Exp $
  4.     $Log: openresource.c,v $
  5.     Revision 1.5  1996/10/24 15:50:53  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/08/13 13:56:05  digulla
  9.     Replaced AROS_LA by AROS_LHA
  10.     Replaced some AROS_LH*I by AROS_LH*
  11.     Sorted and added includes
  12.  
  13.     Revision 1.3  1996/08/01 17:41:15  digulla
  14.     Added standard header for all files
  15.  
  16.     Desc:
  17.     Lang: english
  18. */
  19. #include <exec/execbase.h>
  20. #include <exec/lists.h>
  21. #include <aros/libcall.h>
  22.  
  23. /*****************************************************************************
  24.  
  25.     NAME */
  26.     #include <exec/libraries.h>
  27.     #include <clib/exec_protos.h>
  28.  
  29.     AROS_LH1(APTR, OpenResource,
  30.  
  31. /*  SYNOPSIS */
  32.     AROS_LHA(STRPTR, resName, A1),
  33.  
  34. /*  LOCATION */
  35.     struct ExecBase *, SysBase, 83, Exec)
  36.  
  37. /*  FUNCTION
  38.     Return a pointer to a previously installed resource addressed by name.
  39.     It this name can't be found NULL is returned.
  40.  
  41.     INPUTS
  42.     libName - Pointer to the resource's name.
  43.  
  44.     RESULT
  45.     Pointer to resource or NULL.
  46.  
  47.     NOTES
  48.  
  49.     EXAMPLE
  50.  
  51.     BUGS
  52.  
  53.     SEE ALSO
  54.     AddResource(), RemResource()
  55.  
  56.     INTERNALS
  57.  
  58.     HISTORY
  59.  
  60. *****************************************************************************/
  61. {
  62.     AROS_LIBFUNC_INIT
  63.  
  64.     AROS_LIBBASE_EXT_DECL(struct ExecBase *,SysBase)
  65.     APTR resource;
  66.  
  67.     /* Arbitrate for the resource list */
  68.     Forbid();
  69.  
  70.     /* Look for the resource in our list */
  71.     resource = (APTR) FindName (&SysBase->ResourceList, resName);
  72.  
  73.     /* All done. */
  74.     Permit();
  75.     return resource;
  76.     AROS_LIBFUNC_EXIT
  77. } /* OpenResource */
  78.